package cn.dmrliu.edu.publish.bean;

import cn.dmrliu.edu.publish.util.DoubleUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

@Data
@AllArgsConstructor
public class InteractionReview {
    String courseId;
    String courseName;
    Double avgScore;
    Long userCt;
    Double fiveRate;

    @Override
    public String toString() {
        return "{" +
                "    \"courseName\": \"" + StringUtils.replace(this.courseName, "\\", "_") + "\",\n" +
                "    \"avgScore\": \"" + DoubleUtil.toTwo(this.avgScore) + "\",\n" +
                "    \"userCt\": \"" + this.userCt + "\",\n" +
                "    \"fiveRate\": \"" + DoubleUtil.toTwo(this.fiveRate) + "\"\n" +
                "}";
    }
}
